package com.wawu.server.dao;


import com.wawu.common.annotation.IOC.component.Repository;
import com.wawu.common.utils.SQLBuilder.SelectSQLBuilder;
import com.wawu.common.utils.SQLExcutorUtil;
import com.wawu.pojo.entity.Reply;

import java.sql.SQLException;

@Repository
public class ReplyDAO {
    public Reply getRelayById(Long id) throws SQLException {
        SelectSQLBuilder sqlBuilder=new SelectSQLBuilder("replies")
                .addDynamicCondition("id","=", id)
                .addOrderBy("createtime","DESC");
        return SQLExcutorUtil.querySingle(sqlBuilder.getSQL(), Reply.class,sqlBuilder.getParams());

    }

}
